package com.petshop.controller;

import com.petshop.service.FollowService;
import com.petshop.utils.Result;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/follow")
public class FollowController {
    @Resource
    private FollowService followService;

    /*
    关注和取消关注的方法
     */
    @PutMapping("/{id}/{isFollow}")
    public Result follow(@PathVariable("id") Long followUserId, @PathVariable("isFollow") Boolean isFollow) {
        Result result = followService.follow(followUserId,isFollow);
        return result;
    }
    /*
    判断是否关注
     */
    @GetMapping("/followOrNot/{id}")
    public Result followOrNot(@PathVariable("id") Long followUserId) {
        Result result = followService.isFollow(followUserId);
        return result;
    }
}
